package com.miaoxie.forum.module.im.server.controller;

import com.miaoxie.forum.module.auth.shared.controller.ResponseMessageController;
import com.miaoxie.forum.module.auth.shared.json.JSON;
import com.miaoxie.forum.module.im.server.service.IIMService;
import com.miaoxie.forum.module.im.shared.entity.IMInitEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by miaoxie on 2017/8/19.
 */
@Controller
@RequestMapping("/monitor/bi")
public class IMController extends ResponseMessageController {

    @Autowired
    IIMService imService;
    @RequestMapping("/initIM")
    @ResponseBody
    @JSON
    public Map<String,Object> initIM(String userid){
        IMInitEntity entity = imService.initIm(userid);
        this.getMap().put("result",entity);
        return returnSuccess();
    }
}
